package ro.mvc.framework.servlet;

import ro.mvc.framework.action.Action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by IntelliJ IDEA.
 * User: marina.ciocea
 * Date: 27.07.2010
 * Time: 14:24:29
 * To change this template use File | Settings | File Templates.
 */

public class RequestProcessor {

    public RequestProcessor getRequestProcessor(){
        return null;
    }

    public void process(HttpServletRequest req, HttpServletResponse res){
        try {
            Class action = Class.forName("ro.mvc.web.controller.MarinaAction");
            Action instance = (Action) action.newInstance();
            instance.execute(req, res);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (InstantiationException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IllegalAccessException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
}
